package com.suge.home.module.screen.json;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.suge.common.result.order.OrderResult;
import com.suge.message.dao.SmsMessageDAO;
import com.suge.order.dao.dataobject.SmsOrderDO;
import com.suge.order.manager.SmsOrderManager;

public class TestSometing {

	private static final Logger logger = LoggerFactory.getLogger(TestSometing.class);
	
	@Autowired
    private SmsOrderManager smsOrderManager;

	@Autowired
    private HttpServletRequest request;
	@Autowired
	private SmsMessageDAO smsMessageDAO;
	public void execute(Context context, Navigator nav) {
		
		String str = request.getParameter("num");
		
		
		SmsOrderDO smsOrderDO =  new SmsOrderDO ();
		smsOrderDO.setOrderType(1);
		smsOrderDO.setUserBizorderId(Long.parseLong(str));
		smsOrderDO.setUserNick("test_test");
		logger.error("SUccess lalalallalalalallalal!!!!!!!!!!!!!!!!!!!!!!");
		OrderResult orderResult = smsOrderManager.insertSmsOrder(smsOrderDO);
		logger.error("SUccess lalalallalalalallalal!!!!!!!!!!!!!!!!!!!!!!-------------");
		if(!orderResult.isSuccess()){
			logger.error("YYYYYYYYYYYYYYYYYY:"+orderResult.getErrorMessage());
		}
		else{
			logger.error("SUccess lalalallalalalallalal!!!!!!!!!!!!!!!!!!!!!!");
		}
	}

	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}
	public HttpServletRequest getRequest() {
		return request;
	}

	public void setSmsMessageDAO(SmsMessageDAO smsMessageDAO) {
		this.smsMessageDAO = smsMessageDAO;
	}

	public SmsMessageDAO getSmsMessageDAO() {
		return smsMessageDAO;
	}


	public void setSmsOrderManager(SmsOrderManager smsOrderManager) {
		this.smsOrderManager = smsOrderManager;
	}



}
